ci: stamp builds with git SHA + /api/public/version for deploy verification#537
Merged
Conversation
…tion Deploys repeatedly drifted from the branch HEAD (a manual build run before the latest commit, a stale `:latest` pull, the #534-vs-#535 mixup), and the only way to tell what was actually live was to hand-inspect rendered DOM classes. Make the deployed commit verifiable at a glance. - build-main: pass the short commit SHA as a `BUILD_SHA` build-arg and also tag the pushed image `:git-<sha>` alongside `:latest`, so the image is identifiable by commit. - Dockerfile: accept `BUILD_SHA` (default `unknown`) and set it as a runtime env in the runner stage. - Add GET /api/public/version returning `{ sha }` (the build's commit) so a running deploy can be checked with `curl /api/public/version` — it should report the commit you expect — instead of guessing whether `:latest` is the branch HEAD. Local/dev builds without the arg report "unknown". No app behaviour change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Several recent rounds were lost to not knowing what was actually deployed — a manual build run before the latest commit was pushed, a stale
:latestpull, and the #534-vs-#535 mixup. The only way to tell what was live was hand-inspecting rendered DOM classes. This makes the deployed commit verifiable at a glance.What
BUILD_SHAbuild-arg, and tag the pushed image:git-<sha>alongside:latest(so the image is identifiable by commit, not justlatest).ARG BUILD_SHA(defaultunknown) and set it as a runtime env in the runner stage./api/public/version(hono public route): returns{ "code": 200, "data": { "sha": "<commit>" } }.Usage
After a deploy:
Compare to the branch HEAD you intended to ship — if they differ, the deploy didn't take (rebuild/repull) before spending time debugging behaviour.
Scope
"unknown".